package com.team.activity.mapper;

import com.team.activity.domain.BizUserFollowMerchant;
import org.apache.ibatis.annotations.Select;

/**
* @author 王双印
* @description 针对表【biz_user_follow_merchant】的数据库操作Mapper
* @createDate 2025-07-14 20:18:10
* @Entity com.team.activity.domain.BizUserFollowMerchant
*/
public interface BizUserFollowMerchantMapper {

    int deleteByPrimaryKey(Long id);

    int insert(BizUserFollowMerchant record);

    int insertSelective(BizUserFollowMerchant record);

    BizUserFollowMerchant selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(BizUserFollowMerchant record);

    int updateByPrimaryKey(BizUserFollowMerchant record);

    /**
     * 根据商户ID查询所有关注该商户的用户ID
     */
    java.util.List<Long> selectUserIdsByMerchantId(Long merchantId);

    @Select("select count(1) from biz_user_follow_merchant where user_id = #{userId} and merchant_id = #{activityId}")
    int checkUserFollowMerchant(Long userId, Long activityId);
}
